You are here: Statements and Functions > Group
Syntax samples
GROUP <expression> {AS <entity name>}
GROUP (Var1+Var2)
GROUP 10 AS EntX
Accumulates and temporarily consolidates a specified quantity of entities into a single GROUP shell entity.
The shell entity retains the same attributes as the first entity that was grouped into the shell. However, if the GROUP AS statement is used, the new shell entity does not retain any attribute values, even if the same name is used for the GROUP shell entity as the entities that have been grouped.
The individual entities comprising the group retain their identities, attributes, and resources and are divided from the group when an UNGROUP statement is encountered. The first entity processed from the group takes any resources the group owns. Entities in a group can be grouped into a larger group at another location.
The operation column of process edit tables only. GROUP may not be used in combination with COMBINE, CREATE, LOAD, UNLOAD, SPLIT AS, other GROUP statements in the same processing logic, or with conveyors. An exception to this rule is that an UNGROUP statement may follow a GROUP statement in the same process.
Components
<expression>
The number of entities to group. If this expression is zero, the statement is ignored. If it is less than zero, it generates an error.
This expression is evaluated every time an entity encounters the GROUP statement, so the amount of entities to be combined can vary as the simulation progresses. If it becomes less than or equal to the number of entities already waiting to be combined, the entity that encountered the GROUP statement will be grouped with all the waiting entities.
AS <new entity name>
The optional name of the resulting entity. If left off, the new entity will have the same name as the last entity to complete the group.
GROUP creates a shell (a temporary entity representing grouped entities that starts with cost and time statistics of zero) to which ProModel assigns all cost and time statistics for the group. Each grouped entity retains its individual cost and time statistics and, when you ungroup the entities and the shell disappears, ProModel divides all statistics and cost (accrued by the shell) between them.
Example
In this example, Man, Woman, and Child are grouped together at Floor1 before getting on an elevator. The group of entity types, called Grp_A, is then routed to Floor2 where it will be ungrouped. (See the UNGROUP statement example.)
Process Table
Entity |
Location |
Operation (min) |
---|---|---|
Man |
Floor1 |
WAIT E(2.0) |
Woman |
Floor1 |
WAIT U(3,1) |
Child |
Floor1 |
WAIT N(2.1,.2) |
ALL |
Waiting |
GROUP 10 AS Grp_A |
Grp_A |
Waiting |
GET Elevator |
Routing Table
Blk |
Output |
Destination |
Rule |
Move Logic |
---|---|---|---|---|
1 |
Man |
Waiting |
FIRST 1 |
MOVE FOR 0.5 |
1 |
Woman |
Waiting |
FIRST 1 |
MOVE FOR 0.5 |
1 |
Child |
Waiting |
FIRST 1 |
MOVE FOR 0.5 |
|
|
|
|
|
1 |
Grp_A |
Floor2 |
FIRST 1 |
MOVE WITH Elevator |
COMBINE, ACCUM, GROUPQTY(), and ENTITY(). Also see Attributes.